const arr = ['apple', 'banana', 'apple', 'banana', 'orange']

const count = arr.reduce((accumulator, currentVal) => {
	console.log(accumulator, currentVal, 'sss')
	accumulator[currentVal] = (accumulator[currentVal] || 0) + 1
	return accumulator
}, {})

console.log(count)
